//
//  BCWindowViewController.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/12/6.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import "BCWindowViewController.h"

@interface BCWindowViewController ()

@end

@implementation BCWindowViewController

- (UIStatusBarStyle)preferredStatusBarStyle {
    return [UIApplication sharedApplication].statusBarStyle;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    //
    self.view.backgroundColor = [UIColor clearColor];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if (self.fromController&&self.navigationController) {
        if ([self.fromController isKindOfClass:UINavigationController.class]) {
            UINavigationController *nav = (UINavigationController *)self.fromController;
            self.navigationController.navigationBar.barStyle = nav.navigationBar.barStyle;
        }else if (self.fromController.navigationController) {
            self.navigationController.navigationBar.barStyle = self.fromController.navigationController.navigationBar.barStyle;
        }
    }
}

- (UIBarStyle)barStyleFromController:(UIViewController *)fromController {
    if (fromController) {
        if ([fromController isKindOfClass:UINavigationController.class]) {
            UINavigationController *nav = (UINavigationController *)fromController;
            return nav.navigationBar.barStyle;
        }else if (self.fromController.navigationController) {
            return fromController.navigationController.navigationBar.barStyle;
        }
    }
    return UIBarStyleDefault;
}


- (void)dismissWindow {
    if (_showWindow) {
        _showWindow.hidden = true;
        _showWindow = nil;
    }
}

@end
